package com.lap.auth.configure;

import com.lap.auth.domain.dict.repository.DictTypeRepository;
import com.lap.auth.domain.dict.service.DictTypeValidator;
import com.lap.auth.domain.job.repository.JobRepository;
import com.lap.auth.domain.job.service.JobValidator;
import com.lap.auth.domain.menu.repository.MenuRepository;
import com.lap.auth.domain.menu.service.MenuValidator;
import com.lap.auth.domain.module.repository.ModuleRepository;
import com.lap.auth.domain.module.service.ModuleValidator;
import com.lap.auth.domain.organization.repository.OrgRepository;
import com.lap.auth.domain.organization.service.OrgValidator;
import com.lap.auth.domain.region.repository.RegionRepository;
import com.lap.auth.domain.region.service.RegionValidator;
import com.lap.auth.domain.role.repository.RoleDataScopeRepository;
import com.lap.auth.domain.role.repository.RoleRepository;
import com.lap.auth.domain.role.service.RoleDataScopeService;
import com.lap.auth.domain.role.service.RoleValidator;
import com.lap.auth.domain.user.repository.UserRepository;
import com.lap.auth.domain.user.service.UserRoleValidator;
import com.lap.auth.domain.user.service.UserValidator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DomainConfiguration {

  @Bean
  JobValidator jobValidator(JobRepository repository) {
    return new JobValidator(repository);
  }

  @Bean
  DictTypeValidator dictTypeValidator(DictTypeRepository repository) {
    return new DictTypeValidator(repository);
  }

  @Bean
  OrgValidator orgValidator(OrgRepository repository) {
    return new OrgValidator(repository);
  }

  @Bean
  MenuValidator menuValidator(MenuRepository repository) {
    return new MenuValidator(repository);
  }

  @Bean
  UserValidator userValidator(UserRepository repository) {
    return new UserValidator(repository);
  }

  @Bean
  UserRoleValidator userRoleValidator(RoleRepository repository) {
    return new UserRoleValidator(repository);
  }

  @Bean
  RoleValidator roleValidator(RoleRepository repository) {
    return new RoleValidator(repository);
  }

  @Bean
  RoleDataScopeService dataScopeService(RoleDataScopeRepository repository) {
    return new RoleDataScopeService(repository);
  }

  @Bean
  RegionValidator regionValidator(RegionRepository repository) {
    return new RegionValidator(repository);
  }

  @Bean
  ModuleValidator moduleValidator(ModuleRepository repository) {
    return new ModuleValidator(repository);
  }
}
